<template>
  <div class="app-container">
    <!--操作按钮-->
    <div style="padding-bottom: 30px;" class="operation_container">
      <ul>
        <li><el-button size="mini" @click="handleCancel">返回</el-button></li>
      </ul>
    </div>
    <el-tabs v-model="activeName" type="border-card">
      <el-tab-pane label="基本信息" name="1">
        <customer-form-com :data="data" />
      </el-tab-pane>
      <el-tab-pane label="用电用人明细" name="5">
        <customer-electricty-usage-com v-if="data.id" :data="data" />
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import waves from '@/directive/waves'
import appConstant from '@/constant/AppConstant'
import CustomerApi from '@/api/basic/CustomerApi'
import CustomerElectrictyUsageCom from '../components/CustomerElectrictyUsageCom'
import ContractListCom from '../components/ContractListCom'
import AccountingApListCom from '../components/AccountingApListCom'
import AccountingArListCom from '../components/AccountingArListCom'

export default {
  directives: {
    waves
  },
  components: {
    CustomerElectrictyUsageCom,
    // ContractListCom,
    // AccountingApListCom,
    // AccountingArListCom,
    // CustomerEstimateListCom
  },
  data() {
    return {
      activeName: '1',
      selects: {},
      operation: undefined,
      data: {
        isValid: appConstant.Y

      }
    }
  },
  created() {
    this.initForm()
    this.loadSelects()
  },
  methods: {
    initForm() {
      const id = this.$route.params.id
      CustomerApi.get(id).then(response => {
        this.data = response.data
        // 初始化起运地、目的地数据

      })
    },
    loadSelects() {},
    handleCancel() {
      this.$router.go(-1)
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
</style>
